package com.lanou3g.hw0518.listener; /**
 * If there are no bugs, it was created by Chen FengYao on 2018/5/23;
 * Otherwise, I don't know who created it either
 */

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


@WebListener()
public class AppListener implements ServletContextListener{

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        Set<String> loginUsers = new HashSet<>();
        ServletContext app = sce.getServletContext();
        app.setAttribute("loginUsers",loginUsers);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
